
package Schema::Thread;
use base qw/DBIx::Class::Core/;

__PACKAGE__->load_components(qw/InflateColumn::DateTime/);
__PACKAGE__->table('thread');
__PACKAGE__->add_columns(qw/threadId accountId groupId tweet posted updated replyCount url/);
__PACKAGE__->set_primary_key('threadId');
__PACKAGE__->has_many(replies => 'Schema::Reply', 'threadId');
__PACKAGE__->has_many(repliesDesc => 'Schema::Reply', 'threadId', {order_by => {-desc=>'posted'}});
__PACKAGE__->belongs_to(account => 'Schema::Thread', 'accountId');
1;


